Deploy Voting dApp Smart Contract
In this step, we will be deploying our Voting dApp smart contract to the aelf Sidechain testnet!
Build Smart Contract
To begin, let’s compile and build our smart contract!
Proceed to head over to the capstone_aelf/src directory and run the following command.
dotnet build
You should observe the following as shown below indicating a successful build.
Voting Smart Contract Successfully Compiled!
With our smart contract successfully compiled, we are now ready to deploy our smart contract!
Deploying Your Smart Contract
The smart contract needs to be deployed on the chain before users can interact with it.
Run the following command to deploy a contract.
aelf-deploy -a $WALLET_ADDRESS -p $WALLET_PASSWORD -c $CONTRACT_PATH/$CONTRACT_FILE.dll.patched -e https://tdvw-test-node.aelf.io/
Please wait for approximately 1 to 2 minutes. If the deployment is successful, it will provide you with the contract address.
ℹ️ Note: You are to copy the smart contract address as we will be referencing it in the next quest!
ℹ️ For a more complex use case of a DAO smart contract that utilises tokens as membership, please refer to the Simple DAO Smart Contract Template.
🎉 You have successfully deployed your Voting dApp smart contract on the aelf testnet! In the next quest, we will be building the frontend components that allow us to interact with our deployed smart contract!